//
//  HHViewController.m
//  Fragrance
//
//  Created by yinzhongyuan on 15/5/29.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "HHViewController.h"
#import "CenterViewController.h"
#import "LeftViewController.h"
@interface HHViewController ()<CenterViewControllerDelegate>

@end

@implementation HHViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.navigationItem.title = @"个人中心";

    
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    [button setFrame:CGRectMake(0, 0, 40, 40)];
    
    [button setBackgroundColor:[UIColor orangeColor]];
    button.layer.cornerRadius = 20;
    button.layer.masksToBounds = YES;
    [button setTitle:@"点我哦" forState:UIControlStateNormal];
    button.titleLabel.font = [UIFont systemFontOfSize:10.0];
    [button setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(leftAction:) forControlEvents:UIControlEventTouchUpInside];
    
   

    
    
    
    
    
    UIImage *image = [UIImage imageNamed:@"beijing4"];
    UIImageView *imagev = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height - 64)];
    imagev.image = image;
    [self.view addSubview:imagev];
    imagev.userInteractionEnabled = YES;
    
    UISwipeGestureRecognizer *swipe = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeMe)];
    swipe.direction = UISwipeGestureRecognizerDirectionRight;
    [imagev addGestureRecognizer:swipe];
    
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
    
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(self.view.frame.origin.x + 70, self.view.frame.origin.y + 100, self.view.frame.size.width - 150, self.view.frame.size.height - 300)];
    label.backgroundColor = [UIColor clearColor];
    label.textColor = [UIColor lightGrayColor];
    label.text = @"忙碌的一天终于告一段落，想不想来一顿丰盛而有营养的晚餐哪？也许你没有太多时间去考虑该做些什么，来到这里，我们给您提供最佳的想法。还记得以前您因为忙碌而忘记做的一道菜吗？轻轻向右滑动屏幕，会给你意想不到的惊喜，开始吧~~";
    label.numberOfLines = 15;
    [label sizeToFit];
    label.shadowColor = [UIColor blackColor];
    label.shadowOffset = CGSizeMake(-1.5, -1.5);
    label.font = [UIFont systemFontOfSize:17.0];
    [imagev addSubview:label];
    
    [label release];
    
    [imagev release];
//    UIButton *button1 = [UIButton buttonWithType:UIButtonTypeCustom];
//    button1.frame = CGRectMake(self.view.frame.size.width - 100, 50, 100, 50);
//    [button1 setTitle:@"denglu" forState:UIControlStateNormal];
//    [button1 setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
//    [self.view addSubview:button1];
//    button1.layer.borderWidth = 2;
//    button1.layer.borderColor = [UIColor grayColor].CGColor ;
//    [button1 addTarget:self action:@selector(enroll) forControlEvents:UIControlEventTouchUpInside];
    
    
    
    
}

//- (void)buttonDidPress:(id)sender {
//    CenterViewController *center = [[CenterViewController alloc] init];
//    center.delegate = self;
//    [self.navigationController pushViewController:center animated:YES];
//    
//    
//}
//点击登陆
//- (void)enroll
//{
//    //    //登陆
//        UMSocialSnsPlatform *snsPlatform = [UMSocialSnsPlatformManager getSocialPlatformWithName:UMShareToQQ];
//        snsPlatform.loginClickHandler(self, [UMSocialControllerService defaultControllerService], YES, ^(UMSocialResponseEntity *response){
//    
//            if (response.responseCode == UMSResponseCodeSuccess) {
//                UMSocialAccountEntity *snsAccount = [[UMSocialAccountManager socialAccountDictionary] valueForKey:UMShareToQQ];
//                
//                self.name = snsAccount.userName;
//                self.tupian = snsAccount.iconURL;
//                
//                NSLog(@"%@", self.name);
//                NSLog(@"username is %@, token is %@ url is %@", snsAccount.userName, snsAccount.accessToken, snsAccount.iconURL);
//            }
//        });


    
    
//}


- (void)swipeMe
{
    self.block();
   
}


- (void)press {
    
    [self leftAction:nil];
}

- (void)leftAction:(id)sender
{
    self.block();
    
    
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
